package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BieAlarmRecordsMapper;
import com.ruoyi.system.domain.BieAlarmRecords;
import com.ruoyi.system.service.IBieAlarmRecordsService;

/**
 * 报警记录Service业务层处理
 * 
 * @author zxl
 * @date 2021-05-03
 */
@Service
public class BieAlarmRecordsServiceImpl implements IBieAlarmRecordsService 
{
    @Autowired
    private BieAlarmRecordsMapper bieAlarmRecordsMapper;

    /**
     * 查询报警记录
     * 
     * @param recordsId 报警记录ID
     * @return 报警记录
     */
    @Override
    public BieAlarmRecords selectBieAlarmRecordsById(String recordsId)
    {
        return bieAlarmRecordsMapper.selectBieAlarmRecordsById(recordsId);
    }

    /**
     * 查询报警记录列表
     * 
     * @param bieAlarmRecords 报警记录
     * @return 报警记录
     */
    @Override
    public List<BieAlarmRecords> selectBieAlarmRecordsList(BieAlarmRecords bieAlarmRecords)
    {
        return bieAlarmRecordsMapper.selectBieAlarmRecordsList(bieAlarmRecords);
    }

    /**
     * 新增报警记录
     * 
     * @param bieAlarmRecords 报警记录
     * @return 结果
     */
    @Override
    public int insertBieAlarmRecords(BieAlarmRecords bieAlarmRecords)
    {
        bieAlarmRecords.setCrateTime(new Date());
        bieAlarmRecords.setAccessId(UUID.randomUUID().toString());
        return bieAlarmRecordsMapper.insertBieAlarmRecords(bieAlarmRecords);
    }

    /**
     * 修改报警记录
     * 
     * @param bieAlarmRecords 报警记录
     * @return 结果
     */
    @Override
    public int updateBieAlarmRecords(BieAlarmRecords bieAlarmRecords)
    {
        return bieAlarmRecordsMapper.updateBieAlarmRecords(bieAlarmRecords);
    }

    /**
     * 批量删除报警记录
     * 
     * @param recordsIds 需要删除的报警记录ID
     * @return 结果
     */
    @Override
    public int deleteBieAlarmRecordsByIds(String[] recordsIds)
    {
        return bieAlarmRecordsMapper.deleteBieAlarmRecordsByIds(recordsIds);
    }

    /**
     * 删除报警记录信息
     * 
     * @param recordsId 报警记录ID
     * @return 结果
     */
    @Override
    public int deleteBieAlarmRecordsById(String recordsId)
    {
        return bieAlarmRecordsMapper.deleteBieAlarmRecordsById(recordsId);
    }
}
